public class Test02 {
    public static void main(String[] args) {
        Animal x = new Bird();
        Animal y =new Cat();
        if(x instanceof Cat)
        {
            Cat c = (Cat) x;
            c.CatchMouse();
        }
        else if(x instanceof Bird) {
            Bird bird = (Bird) x;
            bird.sing();
        }
        if(y instanceof Cat)
        {
            Cat c = (Cat) y;
            c.CatchMouse();
        }
        else if(y instanceof Bird) {
            Bird bird = (Bird) y;
            bird.sing();
        }
    }
}
